const Router = require('koa-router')
const {
  verifyUser,
  handlePassword,
  verifyLogin
} = require('../middleware/user.middleware')
const {verifyAuth} = require('../middleware/auth.middleware')
const {
  create,
  login,
  getUser
} = require('../controller/user.controller')

const router = new Router()

router.post('/register', verifyUser, handlePassword, create)
router.post('/login', verifyLogin, login)
router.get('/user', verifyAuth, getUser)

module.exports = router